<?php
// ---- TO BE MOVED ----
function get_lang_list()
{
	$array = array();
	
	$array[0] = array('lang_iso' => 'en', 'lang_name' => 'English');
	$array[1] = array('lang_iso' => 'no', 'lang_name' => 'Norwegian');
	
	return $array;
}

$LANG_LIST = get_lang_list();

$flags_dir = "img/flags/16/";
// ---- END ----
//--------------------------------------------------
//	Filename: lang_select.php
//--------------------------------------------------
//		Information:
// Include this file to print a selection box for 
// selecting language.
//--------------------------------------------------
if( !defined('IN_INDEX') )
{
	die('The content of this page is hidden.');
}
$selected_lang = "";
if(isset($preselected_lang))
{
	$selected_lang = $preselected_lang;
}

// Drop down list for selecting language. Selections availible are stored in $LANG_LIST.
echo "<select name=\"lang_list\">\n";
foreach($LANG_LIST as $key => $val)
{
	if($val['lang_iso'] == $selected_lang)
	{
		echo "<option style=\"background: url('" . $flags_dir . $val['lang_iso'] . ".png') no-repeat #fff; padding-left: 20px;\" value=\"" . $val['lang_iso'] . "\" selected=\"selected\">" . $val['lang_name'] . "</option>\n";
	}
	else
	{
		echo "<option style=\"background: url('" . $flags_dir . $val['lang_iso'] . ".png') no-repeat #fff; padding-left: 20px;\" value=\"" . $val['lang_iso'] . "\">" . $val['lang_name'] . "</option>\n";
	}
}
echo "</select>\n";
?>